import { useState, useEffect } from 'react'
import { Routes, Route, useNavigate } from 'react-router-dom'
import Home from './pages/home'
// import Edit from './pages/edit'
import './assets/css/reset.css'
import './assets/css/common.scss'
window.store = {}

function App() {
  const navigate = useNavigate()
  const [loading, setLoading] = useState(true)

  useEffect(() => {
    window.store = { ...window.store, navigate }
    setLoading(false)
  }, [])

  if (loading) return null
  return (
    <Routes>
      <Route path="/" element={<Home />} />
      {/* <Route path="/edit" element={<Edit />} /> */}
    </Routes>
  )
}

export default App
